package com.coding365.weba.filter;

import com.alibaba.dubbo.common.extension.Activate;
import com.alibaba.dubbo.rpc.*;

@Activate(group = {"consumer"})
public class TransportIPFilter implements Filter {

    @Override
    public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException{
        String clientIp = RpcContext.getContext().getRemoteHost();
        RpcContext.getContext().setAttachment("clientIp",clientIp);
        return invoker.invoke(invocation);
    }
}
